UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S0ZBMkiFLcJbGQHoEiPn3662fmb/poHflz9t2W2QH2E=' 
WHERE 
  key_id = 'fea5b7b413d60e627ca6f42490ea5d055693bf303e65ba93de837888792d7572' 
  AND (
    token = 'S0ZBMkiFLcJbGQHoEiPn3662fmb/poHflz9t2W2QH2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031