UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xmP4GeUIiT/DYdHLHw2TJFMTxGNEhFpo94gON2a8da4=' 
WHERE 
  key_id = 'dad72049ecf2d6298ab42c475905e9dffea1cdfd38d176c21c30614b37d43e51' 
  AND (
    token = 'xmP4GeUIiT/DYdHLHw2TJFMTxGNEhFpo94gON2a8da4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030