UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ju4ZYFxPZKNNi+f8/zn+JoW8ce+6ZcG1aMtLr4EOXPc='
WHERE
key_id = 'f1072d5f4427e5f42ff53b2b842ac772e7790b293cca221687a9a249c9ca8f9f'
AND (
token = 'Ju4ZYFxPZKNNi+f8/zn+JoW8ce+6ZcG1aMtLr4EOXPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)