UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0qIYjgEXPotP7VaBwLX3X363SAMPo3XITC3S7PPpWwA=' 
WHERE 
  key_id = 'eff44abd56c33895035aa0a1e9c64d848df1d5a7c5ddb0a9a1e84d1169711c11' 
  AND (
    token = '0qIYjgEXPotP7VaBwLX3X363SAMPo3XITC3S7PPpWwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027