UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C1vexSE4oGoKG+QPDAmkmXTZeembid1iSYbkae2LTuM=' 
WHERE 
  key_id = 'a29c4b6879b5d421cb3b6cbf9fe302124d35769d68bfa69055fac15616c8f8f2' 
  AND (
    token = 'C1vexSE4oGoKG+QPDAmkmXTZeembid1iSYbkae2LTuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025