UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zzs1vsUrRUxuYLAaNL/PzoTjqZn2ybPEQYn/l82ahCg=' 
WHERE 
  key_id = '176253d90f4cd3ece284e303ae4ad358d79fe6b0aa34469c4f96f0101ee1f158' 
  AND (
    token = 'Zzs1vsUrRUxuYLAaNL/PzoTjqZn2ybPEQYn/l82ahCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00081