UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D24n8kWaLreTm9mlQzdOWSL+kcwF3TAf+kKIFK9cqFs='
WHERE
key_id = '5f8fbaa47bbb413c50bc18bc1bee970f3b9dec02de75e1053807536ad5dd0716'
AND (
token = 'D24n8kWaLreTm9mlQzdOWSL+kcwF3TAf+kKIFK9cqFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)