UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mlTPVJNmKrFBO95Kvd/0pBNDXHDMP59LtYRwjyZSn7U=' 
WHERE 
  key_id = '1e17c9d7d0396146936c2eefe86449f5d965b1bf60903d892aadd21efdd7f7bc' 
  AND (
    token = 'mlTPVJNmKrFBO95Kvd/0pBNDXHDMP59LtYRwjyZSn7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023