UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U4arnnxSrIarXXmUO8jMniqWl/B+Y41QC7P7rdPxcR0='
WHERE
key_id = '1d81fd34b15b6dd726d1d75e6293316078e8681fa7a7c2a338d200d8d9f768d0'
AND (
token = 'U4arnnxSrIarXXmUO8jMniqWl/B+Y41QC7P7rdPxcR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)