UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O3P8tdnXdVbpiGBUoDbaC3Tx4+/C8wKO6F6bwK9YOeI=' 
WHERE 
  key_id = '68bacd9fe729a0b0494adb29d07bf39b84ccfcc48960cc4b0cb4fddd29042f11' 
  AND (
    token = 'O3P8tdnXdVbpiGBUoDbaC3Tx4+/C8wKO6F6bwK9YOeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027