UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iNOzzEwUrrzU7+3QiPuB8zmxXDJIomgHcO6yv1zHqDg=' 
WHERE 
  key_id = '5a2dcf4e2d2ffd6fd21f873883636c28fabb5713b4071746b9e79a916a9e5974' 
  AND (
    token = 'iNOzzEwUrrzU7+3QiPuB8zmxXDJIomgHcO6yv1zHqDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046