UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pv/uvTrgqjHDewvnGuD0C9VMimDdcQn2ub/nA/6n0Nk=' 
WHERE 
  key_id = '9e5ab0e61735af95e0f2892ba5726a886e6ca1320a173b58c562fbcb8b686908' 
  AND (
    token = 'pv/uvTrgqjHDewvnGuD0C9VMimDdcQn2ub/nA/6n0Nk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036