UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A3PmaxAbT9LPXD6ZK3T5kGz36hQ44XsY+Hb1X90Dkho='
WHERE
key_id = 'ee208135f822f69bc4e92c392d62dea69568ad0ac230ea1f9e09cd73957409da'
AND (
token = 'A3PmaxAbT9LPXD6ZK3T5kGz36hQ44XsY+Hb1X90Dkho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)