UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N2Tbbm38bB3AA7z3lIwow4K9gvoQU1XKDO4Yx9/vB9k='
WHERE
key_id = '367a033da1e5e06d972b82734ec8cc4c34cd1a086babb42d2d62457888259e15'
AND (
token = 'N2Tbbm38bB3AA7z3lIwow4K9gvoQU1XKDO4Yx9/vB9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)