UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9dgaI41xOtIiPce1URjplTmm1Yesx7pCYFrLeO5+niI='
WHERE
key_id = '019b0dcd07a28560709a8dfcae38f824dfef441361121544027e8243455169eb'
AND (
token = '9dgaI41xOtIiPce1URjplTmm1Yesx7pCYFrLeO5+niI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)