UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3icQoyvEGCxn2ebSiUtAb1+uORJvjkKj3ZP9z0OoWT8='
WHERE
key_id = '9056672222c220c714c123ed35ef2fe0b4820740983d9982f1dee47866bf0de8'
AND (
token = '3icQoyvEGCxn2ebSiUtAb1+uORJvjkKj3ZP9z0OoWT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)