UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2NPE7f5n5cEGO8Ez8UGiVW6a+JghnfpP0CFevN03xtQ=' 
WHERE 
  key_id = 'b4bfaa3eacc27c77c6d9ab1ae5ac3f09e1b32b25066007ab3dda66257fcecb61' 
  AND (
    token = '2NPE7f5n5cEGO8Ez8UGiVW6a+JghnfpP0CFevN03xtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041