UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nyk6alF1rSvNXLnaq4k/FGxh9PtqC2iITkotOZDEJoA='
WHERE
key_id = 'eb8dcc53e556d6473b09e206b5cae165b4544065f1092242f5f4ef0d7d422645'
AND (
token = 'nyk6alF1rSvNXLnaq4k/FGxh9PtqC2iITkotOZDEJoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)