UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ew/nttIVcl0CewzcPzzcxSqqP9RifNYiJ7JhFBLL8xU='
WHERE
key_id = 'a8968731edd8cad7e43ba9ab447ef2ab71e1ef4e2ca52da402a05e20fef5303d'
AND (
token = 'Ew/nttIVcl0CewzcPzzcxSqqP9RifNYiJ7JhFBLL8xU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)