UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8ufmtftT92GTDhEtkPjo0+z8Tapjn3ujLwFCgNd9ozI=' 
WHERE 
  key_id = '714bd98612a2eff2b3061934f806dd99009ab1b50886c9a35e85e55efe4496b4' 
  AND (
    token = '8ufmtftT92GTDhEtkPjo0+z8Tapjn3ujLwFCgNd9ozI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033