UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/O4Cf0Qsb3kVOjhAcqPC8LjkevxZws85s31Fg7EFnUM='
WHERE
key_id = '0c7ef66b0c132c8be02a548a580a851af4325f45bbf13c8635b16491578dfc91'
AND (
token = '/O4Cf0Qsb3kVOjhAcqPC8LjkevxZws85s31Fg7EFnUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)