UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3sYE6hcSjhWv1XzLZ4gMDPFTfma/fxoZaLGzP35koiA='
WHERE
key_id = 'b527a892fb3aee9a5a51e4b48f01c541baf3fedaba9d8b253d061a86cac94a7e'
AND (
token = '3sYE6hcSjhWv1XzLZ4gMDPFTfma/fxoZaLGzP35koiA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)