UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hr2pSsu8T4yCLq9ku1nbq3a/Sg8HmrBvufjVBY56zDA=' 
WHERE 
  key_id = '77bc83b5fe8dcdaaeb24f118a460ae55390fd6f303d6a8bd9ec0d1e2c4b971fb' 
  AND (
    token = 'Hr2pSsu8T4yCLq9ku1nbq3a/Sg8HmrBvufjVBY56zDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027