UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rf6by6w6uLvnyeU+qBLPz1Lxpp8mu3DqRK6OUkrfXNI='
WHERE
key_id = '48342fea3d61d4e2766c4b7ac39eed5b613d93e897ff844a426ac0e1f8c23f0f'
AND (
token = 'rf6by6w6uLvnyeU+qBLPz1Lxpp8mu3DqRK6OUkrfXNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)