UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd+gUsVZxSrFJPeHi7L9QMTXSqB5QaQgEY+Zq+DaToYM='
WHERE
key_id = '5edec46a2f2688a13110a04ec03e6ad7328980ea7c91c64b4f3784b845706293'
AND (
token = 'd+gUsVZxSrFJPeHi7L9QMTXSqB5QaQgEY+Zq+DaToYM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)