UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k5T79eL+jLaTKv74rqWeuCNC8tMMqdhh1xrqCteW8vk=' 
WHERE 
  key_id = '5f3ea4dacc6d3e7c0f5f786395faa8902b79c1c97843bf1a2bcf608aa6819acd' 
  AND (
    token = 'k5T79eL+jLaTKv74rqWeuCNC8tMMqdhh1xrqCteW8vk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050