UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BomEMkt136vuf1hT0odHrDTa2suglql/e+QwG+dqYSk=' 
WHERE 
  key_id = '380a0c7931cabff830a89bcc1bae10bcebb53ff5953ef8115b3ad525a79910a6' 
  AND (
    token = 'BomEMkt136vuf1hT0odHrDTa2suglql/e+QwG+dqYSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038