UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3xvNYwMXe8WQE6S1GOa2dY9TO4xoFerVrkR2ZC3gYJc='
WHERE
key_id = 'ef205bb2afb11cd69bfbede01f8efb08f29889bde34957f207bcaa5cf14fab70'
AND (
token = '3xvNYwMXe8WQE6S1GOa2dY9TO4xoFerVrkR2ZC3gYJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)