UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rUKXhWIHwOOMYqJMTSR9KlNPTPok4M6I35oXFsQZcYU=' 
WHERE 
  key_id = '17bc29b23f7d5a9791fbebff3da32cdf0e277a226f717fa07936bd3fd49640cb' 
  AND (
    token = 'rUKXhWIHwOOMYqJMTSR9KlNPTPok4M6I35oXFsQZcYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024