UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MksPdfNIF8YDD458sIhiTF97Ql13fIZN4Zc2J/cGJSk=' 
WHERE 
  key_id = '363f7fdf2a12c3f17ef016ddf1ff1456e163bea031ff0ed4a8e5b9bb8dbc3d18' 
  AND (
    token = 'MksPdfNIF8YDD458sIhiTF97Ql13fIZN4Zc2J/cGJSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046