UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+RHghRV9AOVNieq0DuJLBHZPhQ8WS5B0GLMEN2gbESM='
WHERE
key_id = '3656223e29bb9661c31014d1ca9d05471f2d34fe29fa117ca0a14b46e3f557da'
AND (
token = '+RHghRV9AOVNieq0DuJLBHZPhQ8WS5B0GLMEN2gbESM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)