UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uj0F3oBwOwbWeFmY/ch1X3u9scCY+bIIsZKHg5XpXkU='
WHERE
key_id = '0d69d878a2c42dda4c32e048fb47f6a411abdac00b487b39046750d8f0da8af1'
AND (
token = 'Uj0F3oBwOwbWeFmY/ch1X3u9scCY+bIIsZKHg5XpXkU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)