UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cboF+V0+S7jaA8fDmmPGnXP8GDmyWPqDvI0w8+E28Pg=' 
WHERE 
  key_id = '8c6d5df2ab831162326e16f45a73e9a6a69437d1c1e0f8d4eeaa97771978a318' 
  AND (
    token = 'cboF+V0+S7jaA8fDmmPGnXP8GDmyWPqDvI0w8+E28Pg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032