UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PAPQABMvoqgBaTKwWTQEnVBxqu2D8zFnkwgQ+gtSEao='
WHERE
key_id = 'a2cd900fc4303b15d0edde2b2a15a1696d7626e115541eb80004edb421979b61'
AND (
token = 'PAPQABMvoqgBaTKwWTQEnVBxqu2D8zFnkwgQ+gtSEao='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)