UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yj15rnH0m8euXXS9WSNN/dg4ey1K10Jzhsl0vzl4hX0='
WHERE
key_id = '37ae405a9670faa5224f97c36cd29d157f29cd16840d8d8b7962cbd15dab09a5'
AND (
token = 'yj15rnH0m8euXXS9WSNN/dg4ey1K10Jzhsl0vzl4hX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)