UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dycx5E4mPDcbmHvMWSZE9IzfO/Gt53k07nIDNGW2nXI=' 
WHERE 
  key_id = 'e7bd2daf402664a521d2f97bfb9e7855812026cd3af21832c3b02c963375153e' 
  AND (
    token = 'Dycx5E4mPDcbmHvMWSZE9IzfO/Gt53k07nIDNGW2nXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036