UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lj2Z0Cll/YpMZTEi3//oZzREJ4rKp9QBXNs1t7EKDbs=' 
WHERE 
  key_id = '11a2b28cbd8eaddf2190a0519271baf1e4bc5178c0cde0280ba5532f23b1c225' 
  AND (
    token = 'lj2Z0Cll/YpMZTEi3//oZzREJ4rKp9QBXNs1t7EKDbs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021