UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zxEKUnu06PcUVaaecd6xLzWhdWxIsc7cF2WsiGua9p8=' 
WHERE 
  key_id = '12d9d390e421dacac59ac3b83477fed439f367635c71c5ccd61e951756491c11' 
  AND (
    token = 'zxEKUnu06PcUVaaecd6xLzWhdWxIsc7cF2WsiGua9p8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030