UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JpJC/09Rrj5Wev/ysRlAMM9OaTjcnjslasLJEvRvpgg='
WHERE
key_id = '1cd9f47a15a6d3fd558e6775493db91f4bf438f29be7fb2033805920de20d963'
AND (
token = 'JpJC/09Rrj5Wev/ysRlAMM9OaTjcnjslasLJEvRvpgg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)