UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LhxLOQQbligJr0zzF3Z25lQif4Q7ABKgILJ4i5/g7Pc='
WHERE
key_id = 'd111a26c1ed5a49f8a6c32e40d3ec7b00c70882c61cbe166fdf8c5af7098ab94'
AND (
token = 'LhxLOQQbligJr0zzF3Z25lQif4Q7ABKgILJ4i5/g7Pc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)