UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tI19Tyu5wY3zVX+Yad+2rkJ2+3gWrgVIcBvYZ7DBM10='
WHERE
key_id = 'f56e730c3ef9b71f99c9f2fd18448f150dd9721e290dc615f1febffa3679bcae'
AND (
token = 'tI19Tyu5wY3zVX+Yad+2rkJ2+3gWrgVIcBvYZ7DBM10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)