UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's3ApVNutkd8o3F58rnpYrJzCW7xArDmF/Pb4VWuPC5U='
WHERE
key_id = '79d2e32cd3e3242d8804f4e33d3d131593e22bc91722594a9b184da89cee3039'
AND (
token = 's3ApVNutkd8o3F58rnpYrJzCW7xArDmF/Pb4VWuPC5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)