UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ymrCq4Txl2Sg1OEtI7IodGV/2fxEVXPLH4Va7+jSQBM=' 
WHERE 
  key_id = '67e1fd8280e5d750c11ce0673de59378f9037b91570b983013b4ceaef7ff7848' 
  AND (
    token = 'ymrCq4Txl2Sg1OEtI7IodGV/2fxEVXPLH4Va7+jSQBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021