UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vhhk/JDMDgiUWlKJs3fy9vGLh4LNSSfcjubZRIYFe5s=' 
WHERE 
  key_id = '464d94a68d7dc7de158a17ae17c7fc389609a3297a4c249185d90b723b64aa52' 
  AND (
    token = 'vhhk/JDMDgiUWlKJs3fy9vGLh4LNSSfcjubZRIYFe5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026