UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1zXfl2GsTpMrk/5obYV/Vtx6e6or+bkl7VOeq3N6skA='
WHERE
key_id = '39c20f84255c2db33438e978bc2d670b46d61be8901e106b782b1e7b166e8ba5'
AND (
token = '1zXfl2GsTpMrk/5obYV/Vtx6e6or+bkl7VOeq3N6skA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)