UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '57OId7oRa+n/JZ+sE2339SHq2sxhTHNCkfAYrB/rAms=' 
WHERE 
  key_id = 'a92d8c923301350931bbb7a1f285eda6289d83cf6da9fe9e9a8451e94aea848a' 
  AND (
    token = '57OId7oRa+n/JZ+sE2339SHq2sxhTHNCkfAYrB/rAms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026