UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zeh1FJrJrFoYu+RBXRuos85Dl2yQoCOiMp1/h+TYMJ0='
WHERE
key_id = '8532c417e33a7c53b7bf8bb5de2183beaa9a3d1528851477d231eac94d29ef2d'
AND (
token = 'zeh1FJrJrFoYu+RBXRuos85Dl2yQoCOiMp1/h+TYMJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)