UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J3Wvt8zk18p0IlXYQxzxm2m/XzyRu42kx9ZSzd/o7t0=' 
WHERE 
  key_id = 'edb28ad0d6303bf8243271c1b5e5c64dde2b35d8b802f3b8aaa545eb244bc350' 
  AND (
    token = 'J3Wvt8zk18p0IlXYQxzxm2m/XzyRu42kx9ZSzd/o7t0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056