UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SRFBWKOnG31FTiJQAAuYDehujekinBbaQT7UD+sdLUI='
WHERE
key_id = '1e9d1a2df5b8e27d9b09005e9f9c768e83b796b3b1e87b0cd9dd00a8cfb4cba3'
AND (
token = 'SRFBWKOnG31FTiJQAAuYDehujekinBbaQT7UD+sdLUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)