UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wu0slAIItiXxgbljzryVpdOoDQ15/Qi1abEaoGqDVJI='
WHERE
key_id = '8c3e4628dd51802fabaa3eb4f5377a42dee658fb02d36aeb66e62bf8a52656fa'
AND (
token = 'Wu0slAIItiXxgbljzryVpdOoDQ15/Qi1abEaoGqDVJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)