UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7BNwcWx/1xUUICmqv40eauag+mO0ioOodeYjGLW/lLU=' 
WHERE 
  key_id = 'e4eaec96ac1fee4ce891131e3974a3d572945f907dcfa07fde5e2bb129a2bb30' 
  AND (
    token = '7BNwcWx/1xUUICmqv40eauag+mO0ioOodeYjGLW/lLU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044