UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9i0CRvc6zqJ6QEsGaTNhZwNKeEwzKHEmFyKMgUHAcVA='
WHERE
key_id = 'db70489bd588e2295818f1fa33f8870e1f97fe822f5305d09c72bac8e9e15ab5'
AND (
token = '9i0CRvc6zqJ6QEsGaTNhZwNKeEwzKHEmFyKMgUHAcVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)