UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UqEG6cJWyrnhkUo48yK3iwR5dUxWdu+BU7k1WgEk+UM=' 
WHERE 
  key_id = '9828ec8216d2620ac8a3f2df74e5d34e5938ced6566d7ff1619f967a3bea1016' 
  AND (
    token = 'UqEG6cJWyrnhkUo48yK3iwR5dUxWdu+BU7k1WgEk+UM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031