UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LGtuajZ0EwLwPGCR+WDH3xzvpUNnyiqJUCx9g0zky4c=' 
WHERE 
  key_id = 'cf7fefe1476bd4557be503dce5dcbe7a03037bc5fe4efb29b11a62cd6549a745' 
  AND (
    token = 'LGtuajZ0EwLwPGCR+WDH3xzvpUNnyiqJUCx9g0zky4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00120