UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '09lXh1rLBiJ7jolslwO9FPt7sgxc2Uwh2O/3MgETNFQ='
WHERE
key_id = '3533ff4b19ab9c32f1b92f641555b527bff848199dd301cfb0b5f57084ecd91e'
AND (
token = '09lXh1rLBiJ7jolslwO9FPt7sgxc2Uwh2O/3MgETNFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)