UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QOeT2tIYx85wWDoqM4bSl66/Ev3IuXxCzafH04HttrM='
WHERE
key_id = '953327eeba00e880a575d34078d096997a5f35347552ca01abc223ccbc9ad87c'
AND (
token = 'QOeT2tIYx85wWDoqM4bSl66/Ev3IuXxCzafH04HttrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)