UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'byA8b+GpuV8LQGXHQ/flv3nJ+cN7YHZpWrWvLVjN0ns='
WHERE
key_id = 'dc8b02c3691a6deb87446d93b1144cd061df5d5e0894bdac93fa9780ef264dd0'
AND (
token = 'byA8b+GpuV8LQGXHQ/flv3nJ+cN7YHZpWrWvLVjN0ns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)