UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y5un6PrHjKVzDYh4FnI4f3ur7fi4Jw/801LmBMQ+jKc=' 
WHERE 
  key_id = 'f2eaa38bcd059ce9713f863979cd972c277c569de8bbd962bb245987c52dd17f' 
  AND (
    token = 'Y5un6PrHjKVzDYh4FnI4f3ur7fi4Jw/801LmBMQ+jKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066