UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7+aaMeCSjMe8/VTzxwipn2wgiiErAqOCN7V1duMeerQ='
WHERE
key_id = '6be0bf50efa350ad3026924ca3fc5594cf646872ac3c1ed0d838bfb7d1ce9710'
AND (
token = '7+aaMeCSjMe8/VTzxwipn2wgiiErAqOCN7V1duMeerQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)