UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BU+ocd/Wo6iFCpNZUbOJsmpmidRxlfRmDGF8stJG61I='
WHERE
key_id = '4cec784601721e644cdec1d7964694dd0551186bf712c7ce646832c5308ad776'
AND (
token = 'BU+ocd/Wo6iFCpNZUbOJsmpmidRxlfRmDGF8stJG61I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)