UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V7+EbEzSbAdnyZhQb+M9CPfHUItLYvW2+SlDVb8aJx4='
WHERE
key_id = '0b0021f2e9f634871031795811157400e0f7064bb835ae68e852ddee1033f56f'
AND (
token = 'V7+EbEzSbAdnyZhQb+M9CPfHUItLYvW2+SlDVb8aJx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)