UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ubwr6hiyw4gb0aBnlLH7G3Cu2txt7vtoZujfPvqDRd0='
WHERE
key_id = 'ae6ec53bbacce85ff135bd4912cc4a8b67ec3f77ac80f2e53b22d397dc0a481a'
AND (
token = 'Ubwr6hiyw4gb0aBnlLH7G3Cu2txt7vtoZujfPvqDRd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)