UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cAnXnLWiXqci1KBg8A47NogXu/wUrbNeBKtRwx+yr4o=' 
WHERE 
  key_id = 'c0bd658495b3a2a0e8b2189c3ada7c9f7e742feef0804a24cbc4774427ae3493' 
  AND (
    token = 'cAnXnLWiXqci1KBg8A47NogXu/wUrbNeBKtRwx+yr4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024