UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '93Ed4H/I4TdYDDG8F2D6Yf5zn897KWNBKuAnTHq47Dw='
WHERE
key_id = '2d2d217cf4bdc96298483888ff41d915ebfbfd5d5a1d64f78f4cabb25438ac3c'
AND (
token = '93Ed4H/I4TdYDDG8F2D6Yf5zn897KWNBKuAnTHq47Dw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)