UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9IuaD3qqbAGQ+FzdT3pyY0B0OXFFrAVL5pACnmdxxFA=' 
WHERE 
  key_id = '24761dde37da8e634da03bdc08fa0000ed9b2a1ce8cef8fb6c2f187b3ad770ae' 
  AND (
    token = '9IuaD3qqbAGQ+FzdT3pyY0B0OXFFrAVL5pACnmdxxFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028